package kr.hkit.powerjava.chapter8;

/**은행계좌
 * owner - 예금주
 * accoumtNumber -

*/

public class BankAccoumt {
	private String owner;
	private int accoumtNumber;
	private int balance;
	/**예금
	 * @param amoumt 예금액
	*/
	public void deposit(int amount){
		balance += amount;
	}
	
	public int withdraw(int amount){
		if(balance<amount || balance == 0){
			System.out.println();
		return -1;
		}else{
			balance -= amount;
			return amount;
		}
	
	
	}

	@Override
	public String toString() {
		return "BankAccoumt [owner=" + owner + ", accoumtNumber="
				+ accoumtNumber + ", balance=" + balance + "]";
	}
	
}
